---
title: rank_bm25
---

[rank_bm25](https://github.com/dorianbrown/rank_bm25) is an open-source collection of algorithms
designed to query documents and return the most relevant ones, commonly used for creating
search engines.

See its [project page](https://github.com/dorianbrown/rank_bm25) for available algorithms.


## Installation and Setup

First, you need to install `rank_bm25` python package.

<CodeGroup>
```bash pip
pip install rank_bm25
```

```bash uv
uv add rank_bm25
```
</CodeGroup>


## Retriever

See a [usage example](/oss/integrations/retrievers/bm25).

```python
from langchain_community.retrievers import BM25Retriever
```
